package com.taocore.top.title.service;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

import jxl.read.biff.BiffException;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.taocore.top.title.servlet.MainServlet;

public class Top5wDataJob implements Job{

	static Logger _log = Logger.getLogger(Top5wDataJob.class.getName());
	
	@Override
	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		String root = MainServlet.getRootPath();
		String path = root + "WEB-INF/data/week.xls";
		_log.info("path: " + path);
		try {
			WeeklyKeywordsService.importData(path);
		} 
		catch (BiffException e) {
			_log.log(Level.SEVERE, "", e);
		} 
		catch (IOException e) {
			_log.log(Level.SEVERE, "", e);
		}
		catch (Exception e)
		{
			_log.log(Level.SEVERE, "", e);
		}
	}

}
